package cz.muni.fi.pa165.languageschool.dto;

import cz.muni.fi.pa165.languageschool.Language;
import cz.muni.fi.pa165.languageschool.utils.Authority;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Lecturer Data Transfer Object
 *
 * @author Michal Fučík (395624) michal.fuca.fucik(at)gmail.com
 */
public class LecturerTO {

    private Long Id;
    private String firstName;
    private String lastName;
    private List<LectureTO> lectures = new ArrayList<>();
    private Language nativeSpeaker;
    private Set<Language> languages = new HashSet<>();
    private String username;
    private String password;
    private boolean enabled;
    private Authority authority;

    /**
     * Class constructor
     */
    public LecturerTO() {
    }

    /**
     * Class constructor
     *
     * @param Id
     * @param firstName
     * @param lastName
     * @param nativeSpeaker
     * @param username
     * @param password
     * @param authority
     * @param enabled
     * @param languages
     * @param lectures
     */
    public LecturerTO(Long Id,
            String firstName,
            String lastName,
            Language nativeSpeaker,
            String username,
            String password,
            Authority authority,
            boolean enabled,
            Set<Language> languages,
            List<LectureTO> lectures) {
        this.Id = Id;
        this.firstName = firstName;
        this.lastName = lastName;
        this.nativeSpeaker = nativeSpeaker;
        this.username = username;
        this.password = password;
        this.authority = authority;
        this.enabled = enabled;
        this.languages = languages;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public Authority getAuthority() {
        return authority;
    }

    public void setAuthority(Authority authority) {
        this.authority = authority;
    }

    public Long getId() {
        return Id;
    }

    public void setId(Long Id) {
        this.Id = Id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public List<LectureTO> getLectures() {
        return lectures;
    }

    public void setLectures(List<LectureTO> lectures) {
        this.lectures = lectures;
    }

    public Language getNativeSpeaker() {
        return nativeSpeaker;
    }

    public void setNativeSpeaker(Language nativeSpeaker) {
        this.nativeSpeaker = nativeSpeaker;
    }

    public Set<Language> getLanguages() {
        return languages;
    }

    public void setLanguages(Set<Language> languages) {
        this.languages = languages;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.Id != null ? this.Id.hashCode() : 0);
        hash = 97 * hash + (this.firstName != null ? this.firstName.hashCode() : 0);
        hash = 97 * hash + (this.lastName != null ? this.lastName.hashCode() : 0);
        hash = 97 * hash + (this.nativeSpeaker != null ? this.nativeSpeaker.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final LecturerTO other = (LecturerTO) obj;
        if (this.Id != other.Id && (this.Id == null || !this.Id.equals(other.Id))) {
            return false;
        }
        if ((this.firstName == null) ? (other.firstName != null) : !this.firstName.equals(other.firstName)) {
            return false;
        }
        if ((this.lastName == null) ? (other.lastName != null) : !this.lastName.equals(other.lastName)) {
            return false;
        }
        return true;
    }
}
